package com.qfedu.com.qianfeedu.controller;


import com.qfedu.com.qianfeedu.entity.Order;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/order")
public class OrderController {


    @GetMapping("/getorder")
    public String getOrder(Order order){
        return order.getType() + "类型的商品，"+ "库存少了" + order.getNumber() +"件！！！";
    }
    @RequestMapping("/selectOrder")
    public String selectOrder(String orderID,int price,int amount){
        return "这个商品的原价" + price + "实际付款" + amount;

    }

    @PostMapping("/postget")
    public String post1(@RequestBody Order order){
        System.out.println(order.getID());
        System.out.println(order.getNumber());
        System.out.println(order.getPrice());
        return "该订单信息已经插入到数据库，订单编号为"+order.getID();
    }

}
